import java.util.Scanner;

public class MC0415乘积模数 {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        // code here
        int n = input.nextInt();
        long total = 1;
        for (int i = 0; i < n; i++) {
            total = (total * input.nextLong()) %  998244353;
        }
        System.out.println(total);
        input.close();
    }
}
